<link rel="stylesheet" type="text/css" href="../addons/jy_inclock/resource/task.css"/>
<title>任务中心</title>
	<div class="fui-page task-list ">
		<div class="fui-header">
            <div class="fui-header-left">
                <a class="back2 external" ng-click="goback()"></a>
            </div>
            <div class="title">我的任务</div>
            <div class="fui-header-right">
            </div>
        </div>
		<div id="tab" class="fui-tab fui-tab-danger">
      
        <a ng-class="{'external active':pagedata.params.status == 0}" href="javascript:" ng-click="pagedata.params.status=0;tool.get_list('jy_inclock/mine/getlist/',true)">进行中</a>
        <a ng-class="{'external active':pagedata.params.status == 1}" href="javascript:" ng-click="pagedata.params.status=1;tool.get_list('jy_inclock/mine/getlist/',true)">已完成</a>
        <a ng-class="{'external active':pagedata.params.status == 2}" href="javascript:" ng-click="pagedata.params.status=2;tool.get_list('jy_inclock/mine/getlist/',true)">已失败</a>

		</div>
		<div class="fui-content" style="margin-top:4rem">
			
			<div ng-if="pagedata.list.length==0" style="height: 7rem;line-height:7rem;width: 100%;text-align: center;color: #d0d0d0;font-size: 1rem">暂时没有任何任务</div>
	
			<div class="mytask-list-group">
			
				<a ng-repeat="record in pagedata.list" class="mytask-list">
					<div class="mytask-list-top">
						<div class="mytask-list-media">
							<img src="{{tomedia(record.taskimage)}}"/>
						</div>
						<div class="mytask-list-inner">
							<div class="title">{{record.tasktitle}}</div>
							<div class="time">
								<p>领取时间：{{record.picktime}}</p>
								<p>截至时间：{{ifelse(record.stoptime=='0000-00-00 00:00:00','无',record.stoptime)}}</p>
								<p>任务奖励：{{record.rewarddesc}}<span class="label label-info" ng-if="record.isreward">已领取</span></p>
							</div>
						</div>
						<div class="mytask-list-right">
							<div ng-if="record.status==0">进行中</div>
							<div ng-if="record.status==1">已完成</div>
							<div ng-if="record.status==2">已失败</div>				
							<div class="detail" href="javascript:;" ng-click="access_json('/detail//id='+record.taskid)">
								详情</div>
						</div>
					</div>
					<div class="mytask-progress">
						进度
						<div class="progress">
							<div class="progress-inner" style="width: {{record.task_progress/record.task_demand*100}}%;"></div>
						</div>
						<span class="times">{{record.task_progress}}/{{record.task_demand}}</span>
						<div ng-if="record.ispass!=1" class="btn btn-sm btn-danger-o r-f" style="margin-left:0.5rem;border-radius:1rem" href="javascript:;" ng-click="access_json('/add_log//id='+record.id)">前往打卡</div>
						<div class="btn btn-sm btn-danger-o r-f" style="margin-left:0.5rem;border-radius:1rem" href="javascript:;" ng-click="access_json('/log//id='+record.id)">打卡记录</div>
						<div ng-if="record.lastgettime && record.isreward!=1" class="btn btn-sm btn-danger-o r-f" style="margin-left:0.5rem;border-radius:1rem" href="javascript:;">{{record.lastgettime}}天后领取奖励</div>
						<div ng-if="!record.lastgettime && record.ispass==1 && record.isreward!=1" class="btn btn-sm btn-danger-o r-f" style="margin-left:0.5rem;border-radius:1rem" href="javascript:;" ng-click="post({},'/mine/checkfinish/id='+record.id)">领取奖励</div>
					</div>
				</a>
			</div>
		</div>
	</div>
<div ng-include="sys_html('_footer')"></div>	
<script>
scope.tool.get_list('jy_inclock/mine/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_inclock/mine/getlist/');
}
</script>